﻿Imports MiningTool.My.Resources
Imports MiningTool.Org.Mentalis.Files
Public Class options
    Public Shared RUNNING_PATH As String = My.Application.Info.DirectoryPath
    Private Sub options_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim ini As New IniReader(RUNNING_PATH & "\config.ini")
        ini.Section = "MAIN"
        Dim its_lang As String = ini.ReadString("LANG").ToString()
        ini.Section = "LANG-" & its_lang

        ListBox1.Items.Add(ini.ReadString("TEXT-16"))
        ListBox1.Items.Add(ini.ReadString("TEXT-17"))
        Button1.Text = ini.ReadString("TEXT-18")

    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim selected_lang As String
        If ListBox1.SelectedItem = "german" Or ListBox1.SelectedItem = "Deutsch" Then
            selected_lang = "DE"
        End If
        If ListBox1.SelectedItem = "english" Or ListBox1.SelectedItem = "Englisch" Then
            selected_lang = "US"
        End If

        Dim ini As New IniReader(RUNNING_PATH & "\config.ini")
        ini.Section = "MAIN"
        ini.Write("MAIN", "LANG", selected_lang)

        MiningTool.Form1.Show()
        Me.Close()
    End Sub
End Class